use serde::{Deserialize, Serialize};
use utoipa::ToSchema;

/// 创建用户请求
#[derive(Debug, Serialize, Deserialize, ToSchema)]
pub struct CreateUserRequest {
    /// 用户名
    pub username: String,
    /// 昵称
    pub nickname: String,
    /// 手机号
    pub mobile: Option<String>,
    /// 角色ids
    pub role_ids: Vec<i32>,
}

/// 更新用户请求
#[derive(Debug, Serialize, Deserialize, ToSchema)]
pub struct UpdateUserRequest {
    /// 昵称
    pub nickname: String,
    /// 手机号
    pub mobile: Option<String>,
}

/// 修改用户
#[derive(Debug, Serialize, Deserialize, ToSchema)]
pub struct ModifyUser {
    /// 用户id
    pub id: i32,
    /// 昵称
    pub nickname: String,
    /// 手机号
    pub mobile: Option<String>,
    /// 角色ids
    pub role_ids: Vec<i32>,
}

/// 分页查询用户请求
#[derive(Debug, Serialize, Deserialize, ToSchema)]
pub struct PageUserRequest {
    /// 页码
    pub page: u64,
    /// 每页数量
    pub per_page: u64,
    /// 昵称
    pub nickname: Option<String>,
}

/// 修改密码请求
#[derive(Debug, Serialize, Deserialize, ToSchema)]
pub struct ChangePasswordRequest {
    /// 旧密码
    pub old_password: String,
    /// 新密码
    pub new_password: String,
    /// 确认密码
    pub confirm_password: String,
}
